import 'package:intl/intl.dart';

//intl  来扩展 继承   extension   xxx  on xxx
extension ExDataTime on DateTime{
  String toDateString({String format = 'yyyy-MM-dd'}) =>
      DateFormat(format).format(this);

  int get nowTicket => this.microsecondsSinceEpoch;

}


void main(){
  var now =DateTime.now();
  print(now.toDateString());
  print(now.nowTicket);
}